#ifndef FACE_SERVER_H
#define FACE_SERVER_H

#include <QMainWindow>
#include <QTcpSocket>
#include <QTcpServer>
#include "faceobject.h"
#include <QSqlTableModel>
#include <QSqlRecord>


using namespace  cv;
QT_BEGIN_NAMESPACE
namespace Ui { class Face_Server; }
QT_END_NAMESPACE

class Face_Server : public QMainWindow
{
    Q_OBJECT

public:
    Face_Server(QWidget *parent = nullptr);
    ~Face_Server();

private slots:
    void accept_client();
    void read_data();
    void recv_faceid(int64_t faceid);

signals:
    void query(cv::Mat& image);
private:
    Ui::Face_Server *ui;
    QTcpServer mserver;
    QTcpSocket *msocket;
    qint64 bsize;

    FaceObject fobj;
    QSqlTableModel model;
};
#endif // FACE_SERVER_H
